CC = g++
CFLAGS = -Wall -c
LFLAGS = -Wall

All: binary_search_unit matrix_unit sort_unit complete_unit

complete: complete.cpp complete.h
	$(CC) $(CFLAGS) complete.cpp

complete_unit_test: complete_unit_test.cpp
	$(CC) $(CFLAGS) complete_unit_test.cpp

complete_unit: complete complete_unit_test
	$(CC) $(LFLAGS) complete.o complete_unit_test.o -o complete_unit

sort: sort.cpp sort.h
	$(CC) $(CFLAGS) sort.cpp

sort_unit: sort

matrix: matrix.cpp matrix.h
	$(CC) $(CFLAGS) matrix.cpp

matrix_unit_test: matrix_unit_test.cpp
	$(CC) $(CFLAGS) matrix_unit_test.cpp

matrix_unit: matrix matrix_unit_test
	$(CC) $(LFLAGS) matrix.o matrix_unit_test.o -o matrix_unit

binary_search: binary_search.cpp binary_search.h
	$(CC) $(CFLAGS) binary_search.cpp

binary_search_unit_test: binary_search_unit_test.cpp
	$(CC) $(CFLAGS) binary_search_unit_test.cpp

binary_search_unit: binary_search binary_search_unit_test
	$(CC) $(LFLAGS) binary_search.o binary_search_unit_test.o -o binary_search_unit

clean:
	rm *.o
	rm *unit
